package top.ed333.mcplugins.configurableevents.action;

import org.bukkit.entity.Player;
import org.jetbrains.annotations.Nullable;
import top.ed333.mcplugins.configurableevents.DependenciesResolver;
import top.ed333.mcplugins.configurableevents.VaultHelper;

public class EcoGiveAction extends Action {
    public EcoGiveAction(double value) {
        super(value);
    }

    @Override
    public String name() {
        return "eco-give";
    }

    @Override
    public void execute(@Nullable Player player) {
        if (player == null) return;
        if (DependenciesResolver.isVaultInstalled()) {
            VaultHelper.depositPlayer(player, (double) value());
        }
    }
}
